package cim3d;

import com.ht.aems.ntp.CIMConstants;

/**
 * Created by IntelliJ IDEA.
 *
 * @author Dong Shufeng
 *         Date: 2009-10-30
 */
public class MeasureProvider implements CIMConstants {
    //public static final int LINE_SWITCH_OFF = 0;
    //public static final int LINE_SWITCH_ON = 1;
    //public static final int LINE_SWITCH_UNKOWN = 2;
    //
    //public static Map<String, AnalogValue> scada_line_active = new HashMap<String, AnalogValue>();
    //public static Map<String, Integer> line_state = new HashMap<String, Integer>();
    //public static Map<String, Double> plant_gen_mw = new HashMap<String, Double>();
    //public static Map<String, Double> plant_gen_mw_max = new HashMap<String, Double>();
    //public static Map<String, Double> area_mw_max = new HashMap<String, Double>();
    //public static Map<String, Double> area_mvar_max = new HashMap<String, Double>();
    //public static Map<String, Double> area_mw = new HashMap<String, Double>();
    //public static Map<String, Double> area_mvar = new HashMap<String, Double>();
    //
    //
    //static {
    //    List<ACLineSegment> lines = SystemModel.INSTANCE.getSnapshot().getResourceManager().getResource(ACLineSegmentImpl.class);
    //    for (ACLineSegment line : lines) {
    //        line_state.put(line.getMRID(), LINE_SWITCH_UNKOWN);
    //        formLineMeasure((Terminal) line.getTerminals().get(0));
    //        formLineMeasure((Terminal) line.getTerminals().get(1));
    //    }
    //}
    //
    //private static void formLineMeasure(Terminal terminal) {
    //    List measList = terminal.getMeasurements();
    //    for (Object meas : measList) {
    //        if (meas instanceof Analog) {
    //            Analog measure = (Analog) meas;
    //            List measValueList = measure.getContain_MeasurementValues();
    //            if (measValueList == null || measValueList.size() == 0)
    //                continue;
    //            MeasurementType type = measure.getMeasurementType();
    //            if (type == null || type.getName() == null || !type.getName().equals(TYPE_THREE_PHASE_ACTIVE_POWER))
    //                continue;
    //            for (Object measValue : measValueList) {
    //                AnalogValue analogValue = ((AnalogValue) measValue);
    //                if (analogValue.getMeasurementValueSource().getName().equals(MEASURE_VALUE_SOURCE_SCADA)) {
    //                    scada_line_active.put(terminal.getMRID(), analogValue);
    //                    return;
    //                }
    //            }
    //        }
    //    }
    //}
}
